<!--added by yiang -->
<!--display the board-->

<div class="borad-topic-count" style="margin-top:10px">
  <div>
    <span>共有<%= link_to @topics_count %>个贴子
  	<span style="float: right">
  	按&nbsp;
  	<% if "review_num DESC".eql?(@sort_tag) %>
  	<%= link_to "时间", open_source_project_relative_memos_path(@open_source_project, :sort_field => 'created_time DESC'), :method => 'get' %>
  	&nbsp;&nbsp;/&nbsp;
  	<%= link_to "回帖 ↓", open_source_project_relative_memos_path(@open_source_project, :sort_field => 'review_num ASC'), :method => 'get' %>
  	&nbsp;&nbsp;/&nbsp;
  	<%= link_to "浏览", open_source_project_relative_memos_path(@open_source_project, :sort_field => 'view_num DESC'), :method => 'get' %>
  	
  	<% elsif "created_time DESC".eql?(@sort_tag) %>
  	<%= link_to "时间 ↓", open_source_project_relative_memos_path(@open_source_project, :sort_field => 'created_time ASC'), :method => 'get' %>
  	&nbsp;&nbsp;/&nbsp;
  	<%= link_to "回帖", open_source_project_relative_memos_path(@open_source_project, :sort_field => 'review_num DESC'), :method => 'get' %>
  	&nbsp;&nbsp;/&nbsp;
  	<%= link_to "浏览", open_source_project_relative_memos_path(@open_source_project, :sort_field => 'view_num DESC'), :method => 'get' %>
  	
  	<% elsif "view_num DESC".eql?(@sort_tag) %>
  	<%= link_to "时间", open_source_project_relative_memos_path(@open_source_project, :sort_field => 'created_time DESC'), :method => 'get' %>
  	&nbsp;&nbsp;/&nbsp;
  	<%= link_to "回帖", open_source_project_relative_memos_path(@open_source_project, :sort_field => 'review_num DESC'), :method => 'get' %>
  	&nbsp;&nbsp;/&nbsp;
  	<%= link_to "浏览 ↓", open_source_project_relative_memos_path(@open_source_project, :sort_field => 'view_num ASC'), :method => 'get' %>
  	
  	
  	<% elsif "review_num ASC".eql?(@sort_tag) %>
  	<%= link_to "时间", open_source_project_relative_memos_path(@open_source_project, :sort_field => 'created_time DESC'), :method => 'get' %>
  	&nbsp;&nbsp;/&nbsp;
  	<%= link_to "回帖 ↑", open_source_project_relative_memos_path(@open_source_project, :sort_field => 'review_num DESC'), :method => 'get' %>
  	&nbsp;&nbsp;/&nbsp;
  	<%= link_to "浏览", open_source_project_relative_memos_path(@open_source_project, :sort_field => 'view_num DESC'), :method => 'get' %>
  	
  	<% elsif "created_time ASC".eql?(@sort_tag) %>
  	<%= link_to "时间 ↑", open_source_project_relative_memos_path(@open_source_project, :sort_field => 'created_time DESC'), :method => 'get' %>
  	&nbsp;&nbsp;/&nbsp;
  	<%= link_to "回帖", open_source_project_relative_memos_path(@open_source_project, :sort_field => 'review_num DESC'), :method => 'get' %>
  	&nbsp;&nbsp;/&nbsp;
  	<%= link_to "浏览", open_source_project_relative_memos_path(@open_source_project, :sort_field => 'view_num DESC'), :method => 'get' %>
  	
  	<% elsif "view_num ASC".eql?(@sort_tag) %>
  	<%= link_to "时间", open_source_project_relative_memos_path(@open_source_project, :sort_field => 'created_time DESC'), :method => 'get' %>
  	&nbsp;&nbsp;/&nbsp;
  	<%= link_to "回帖", open_source_project_relative_memos_path(@open_source_project, :sort_field => 'review_num DESC'), :method => 'get' %>
  	&nbsp;&nbsp;/&nbsp;
  	<%= link_to "浏览 ↑", open_source_project_relative_memos_path(@open_source_project, :sort_field => 'view_num DESC'), :method => 'get' %>
  	
  	
  	<% else %>
  	<%= link_to "时间", open_source_project_relative_memos_path(@open_source_project, :sort_field => 'created_time DESC'), :method => 'get' %>
  	&nbsp;&nbsp;/&nbsp;
  	<%= link_to "回帖", open_source_project_relative_memos_path(@open_source_project, :sort_field => 'review_num DESC'), :method => 'get' %>
  	&nbsp;&nbsp;/&nbsp;
  	<%= link_to "浏览", open_source_project_relative_memos_path(@open_source_project, :sort_field => 'view_num DESC'), :method => 'get' %>
  	<% end %>
  	
  	&nbsp;排序
  	
  </span>
  </span>
</div>
</div>
<div style="padding-top: 10px">
  <% unless @relative_memo_ids.nil? %>
      <% @relative_memo_ids.each do |topic_id| %>
          <% topic=topic_id.topic %>
          <% if !topic.nil? %>
          <table class="content-text-list">
            <tr>
              <td colspan="2" valign="top" width="50"><%= link_to image_tag(url_to_avatar(topic.author), :class => "avat0ar"), user_path(topic.author) if topic.author %>
                <%= image_tag('../images/avatars/User/0', :class => "avatar") unless topic.author %> </td>
              <td>
                <table width="630px" border="0">
                  <tr>
                    <td valign="top" width="500px" class="<%= topic.sticky ? 'sticky' : '' %> <%= topic.locked? ? 'locked' : '' %>">
                      <% if topic.url.nil? || topic.url == '' %>
                          <%= link_to h(topic.title), open_source_project_relative_memo_path(open_source_project, topic) %>
                      <% else %>
                          <%= link_to h(topic.title), topic.url, :target => '_blank' %>
                      <% end %></td>
                    <td align="right" rowspan="3">
                      <table class="borad-count">
                        <tr>
                          <td align="center" class="borad-count-digit"><%= link_to (topic.review_num), topic.url, :target => '_blank' %></td>
                        </tr>
                        <tr>
                          <td align="center">回帖</td>
                        </tr>
                      </table>
                    </td>

                    <td align="right" rowspan="3">
                      <table class="borad-count">
                        <tr>
                          <td align="center" class="borad-count-digit"><%= link_to (topic.collection_num), topic.url, :target => '_blank' %></td>
                        </tr>
                        <tr>
                          <td align="center">关注</td>
                        </tr>
                      </table>
                    </td>

                    <td align="right" rowspan="3">
                      <table class="borad-count">
                        <tr>
                          <td align="center" class="borad-count-digit"><%= link_to (topic.view_num+topic.view_num_ossean), topic.url, :target => '_blank' %></td>
                        </tr>
                        <tr>
                          <td align="center">浏览</td>
                        </tr>
                      </table>
                    </td>
                  </tr>
                  <tr>
                    <td><span class="font_description"> </span></td>
                  </tr>
                  <tr>
                    <td align="left"><span class="font_lighter"><%= user_url_and_time topic.author, topic.url, topic.created_time %>
                      <br/>
					</span></td>
                  </tr>
                  <tr>
                    <td align="left">帖子来源：<span class="font_lighter" style="color: #068d9c"><%= link_to topic.source.blank? ? 'Trustie' : topic.source, topic.url %>
					</span></td>
                  </tr>


                </table>
              </td>
            </tr>

          </table>
          <% end %>
      <% end %>
      <div class="pagination">
        <%= pagination_links_full @topics_pages, @topics_count %>
      </div>
  <% else %>
      <p class="nodata">
        <%= l(:label_no_data) %>
      </p>
  <% end %>
</div>
